//
//  SecurityViewController.m
//  TenThousand
//
//  Created by 我的 on 16/6/20.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "SecurityViewController.h"

#import "LawGuaranteeViewController.h"//法律保障Controller
#import "RiskGuaranteeViewController.h"//风控保障Controller
#import "ChannelGuaranteeViewController.h"//渠道保障Controller
#import "FundGuaranteeViewController.h"//资金保障Controller

@interface SecurityViewController ()


@end
#define subController @[@"InformationViewController",@"InvestmentVC",@"RepaymentscheduleViewController"]
#define TITLE @[@"法律保障",@"风控保障",@"渠道保障",@"资金保障"]
@implementation SecurityViewController

-(NSArray<NSString *> *)titles {
    
    return TITLE;
}

-(instancetype)init{
    
    if (self = [super init]) {
        
        self.menuViewStyle = WMMenuViewStyleLine;
        self.titleSizeNormal = 14;
        self.titleSizeSelected = 16.0;
        self.menuItemWidth = Screen_Width/4;
        self.menuHeight = 40;
    }
    return self;
    
}

#pragma mark --实现WMPageControllerDataSource
- (NSInteger)numbersOfChildControllersInPageController:(WMPageController *)pageController {
    return self.titles.count;
}

- (NSString *)pageController:(WMPageController *)pageController titleAtIndex:(NSInteger)index {
    return self.titles[index];
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setDataSource:self];
    [self setDelegate:self];
    self.navigationItem.title = @"安全保障";
    [self createLeft:[UIImage imageNamed:@"ZHSZicon_03"] leftClick:^{
        [self.navigationController popViewControllerAnimated:YES];
    } right:nil rightClick:nil];
    //大于7.0版本设置
    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
        self.edgesForExtendedLayout = UIRectEdgeNone;
        self.extendedLayoutIncludesOpaqueBars = NO;
        self.modalPresentationCapturesStatusBarAppearance = NO;
    }
    self.view.backgroundColor = [UIColor colorWithRed:237/255.0 green:237/255.0 blue:237/255.0 alpha:1];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
}

#pragma mark - Tab Pager Data Source


- (UIViewController *)pageController:(WMPageController *)pageController viewControllerAtIndex:(NSInteger)index {
    
    if (index == 0) {
        LawGuaranteeViewController *law = [[LawGuaranteeViewController alloc] init];
        return law;
    }else if (index == 1){
        RiskGuaranteeViewController *risk = [[RiskGuaranteeViewController alloc] init];
        return risk;
    }else if (index == 2){
        ChannelGuaranteeViewController *channel = [[ChannelGuaranteeViewController alloc] init];
        return channel;
    }else{
        FundGuaranteeViewController *fund= [[FundGuaranteeViewController alloc] init];
        return fund;
    }
    
}








@end
